Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support TraceBWConfig #13

Merged
merged 12 commits into from
Dec 6, 2024
Merged

feat: support TraceBWConfig #13

merged 12 commits into from
Dec 6, 2024

Conversation

Lethe10137
Copy link
Contributor

@Lethe10137 Lethe10137 commented Nov 3, 2024

Description

Support a new kind of Bandwidth Trace that is more expressive and compact than mahimahi trace and can be replayed by rattan.
An example:

 {"RepeatedBwPatternConfig":{"pattern":[{"TraceBwConfig":[
    [1.0,[2.0,4.0,3.5,4.23,3.3]],
    [0.6,[1.0, 3.2, 3.5]]
]}],"count":0}}

denotes a (repeated) sequence of

1.0ms 2.0Mbps
1.0ms 4.0Mbps
1.0ms 3.5Mbps
1.0ms 4.23Mbps
1.0ms 3.3Mbps
0.6ms 1.0Mbps
0.6ms 3.2Mbps
0.6ms 3.5Mbps

.

Also, provide the funtion build_truncated for NormalBwConfig, where the impact of truncation (lower_bound and upper_bound field) on the mathematical expectation of the distribution is taking account by modifing the center of the distribution.

For example (as shown in the doc test), if we define a NormalBw with both a mean and std_dev of 12Mbps, lowerbound of 0 and no upperbound, under the random seed of 42, the average bandwidth of 100,000 samples are 12.97Mbps by the original build and 11.98Mbps by the new build_truncated.

How Has This Been Tested

Doc test has been wirtten to test the changes. The changes are incremental functions, structs, mods, and will not affect the other areas of the code.

Types of changes

New feature (non-breaking change which adds functionality)

Checklist

  • Code follows the code style of this project.
  • Changes follow the CONTRIBUTING guidelines.
  • Update necessary documentation accordingly.
  • Lint and tests pass locally with the changes.
  • Check issues and pull requests first. You don't want to duplicate effort.

Other information

@Lethe10137 Lethe10137 requested a review from BobAnkh November 25, 2024 02:59
@Lethe10137 Lethe10137 marked this pull request as ready for review November 25, 2024 03:00
@Lethe10137 Lethe10137 self-assigned this Nov 25, 2024
src/model/mod.rs Outdated Show resolved Hide resolved
src/model/solve_truncate.rs Outdated Show resolved Hide resolved
src/model/trace_serde.rs Outdated Show resolved Hide resolved
src/lib.rs Show resolved Hide resolved
Copy link
Member

@BobAnkh BobAnkh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have roughly reviewed the updates. Please fix the CI errors and some changes requested, and I will review it again. Also, please click resolve conversation for any completed requested change and at me when the pr is ready.

src/model/solve_truncate.rs Outdated Show resolved Hide resolved
src/model/solve_truncate.rs Outdated Show resolved Hide resolved
.github/workflows/cargo-test.yml Outdated Show resolved Hide resolved
.github/workflows/cargo-test.yml Outdated Show resolved Hide resolved
src/model/bw.rs Outdated Show resolved Hide resolved
src/model/bw.rs Outdated Show resolved Hide resolved
@Lethe10137 Lethe10137 force-pushed the file-trace branch 2 times, most recently from 92eef13 to 3077d6b Compare December 5, 2024 11:54
src/model/bw.rs Outdated Show resolved Hide resolved
@Lethe10137
Copy link
Contributor Author

I think it is done.@BobAnkh

@BobAnkh
Copy link
Member

BobAnkh commented Dec 5, 2024

I think it is done.@BobAnkh

No, I don't think so. Have you resolve or reply to this?

Copy link
Member

@BobAnkh BobAnkh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of the codes are well, only two small changes are requested (the other is the name of function).

src/model/bw.rs Outdated Show resolved Hide resolved
@Lethe10137
Copy link
Contributor Author

I have solved them. @BobAnkh

@BobAnkh BobAnkh merged commit 1cd2019 into main Dec 6, 2024
9 checks passed
@BobAnkh BobAnkh deleted the file-trace branch December 6, 2024 05:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants